package com.tchepannou.limbe.validation;

import java.lang.reflect.Field;

/**
 * User: herve
 * Date: 14-01-12 11:43 AM
 */
public class AssertFalseValidator extends AbstractValidator
{
    @Override
    public boolean validate(Object bean, Field field)
    {
        Object value = getValue(bean, field);
        if (Boolean.class.isAssignableFrom(field.getType()))
        {
            return value == null || ((Boolean)value) == false;
        }
        else
        {
            return false;
        }
    }

    @Override
    public boolean validate(Object bean)
    {
        return true;
    }
}
